<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.global.js"></script>
</head>

<body>
    <div id="app">
        <!-- v-bind缩写为: -->
        <!-- 完整语法 -->
        <a v-bind:href="url">点我</a>
        <!-- 缩写 -->
        <a :href="url">点我</a>
        <!-- 动态参数的缩写 -->
        <a :[key]="url">点我</a>


        <!-- v-on缩写为@ -->
        <!-- 完整语法 -->
        <a v-on:click="doSomething">44944</a>

        <!-- 缩写 -->
        <a @click="doSomething">44944</a>

        <!-- 动态参数的缩写 -->
        <a @[event]="doSomething">44944</a>
    </div>

    <script>
        const app = {
            data() {
                return {
                    url: "http://www.baidu.com",
                    key: "href",
                    event:"click"
                }
            },
            methods:{
                doSomething(){
                    alert("shit off")
                }
            }
        }
        Vue.createApp(app).mount("#app")
    </script>
</body>

</html>